import { createRouter, createWebHistory } from 'vue-router'

// 引入布局组件
import LayoutView from '@/views/layout/index.vue'
import HomeView from '@/views/index/index.vue'
import ClazzView from '@/views/clazz/index.vue'
import StuView from '@/views/stu/index.vue'
import deptView from '@/views/dept/index.vue'
import EmpView from '@/views/emp/index.vue'
import EmpReportView from '@/views/report/emp/index.vue'
import StuReportView from '@/views/report/stu/index.vue';
import LogView from '@/views/log/index.vue';
import LoginView from '@/views/login/index.vue';
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: '',
      redirect: '/index',
      component: LayoutView,
      children: [
        {
          path: 'index',
          name: 'index',
          component: HomeView
        },
        {
          path: 'clazz',
          name: 'clazz',
          component: ClazzView
        },
        {
          path: 'stu',
          name: 'stu',
          component: StuView
        },
        {
          path: 'dept',
          name: 'dept',
          component: deptView
        },
        {
          path: 'emp',
          name: 'emp',
          component: EmpView
        },
        {
          path: 'empReport',
          name: 'empReport',
          component: EmpReportView
        },
        {
          path: 'stuReport',
          name: 'stuReport',
          component: StuReportView
        },
        {
          path: 'log',
          name: 'log',
          component: LogView
        },
      ]

    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
  ]
})

export default router
